package com.shop.cereshop.agent.controller.voucher;

import com.shop.cereshop.agent.service.voucher.AgentVoucherService;
import com.shop.cereshop.commons.domain.agent.CereAgentRole;
import com.shop.cereshop.commons.domain.voucher.CereAgentVoucher;
import com.shop.cereshop.commons.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.List;

/**
 * 代金券接口
 */
@RequestMapping("voucher")
@RestController
@Api(value = "代理商代金券接口", tags = "代理商代金券接口")
public class AgentVoucherController {

  @Autowired
  private AgentVoucherService agentVoucherService;

  @GetMapping("get")
  @ApiOperation(value = "获取准代理商城市代金券接口")
  public Result<CereAgentVoucher> getAreaVoucher(@RequestParam @ApiParam(value = "用户选择城市后所需支付金额", required = true) BigDecimal amount) {
    return Result.success(agentVoucherService.getAreaVoucher(amount));
  }
}
